package com.gxa.client_shoppings.service.impl;

import com.gxa.client_shoppings.mapper.SendAreaMapper;
import com.gxa.client_shoppings.pojo.SendArea;
import com.gxa.client_shoppings.service.SendAreaService;
import com.gxa.client_shoppings.utils.JsonResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author smile_ZhongXuan
 * @Date 2020/11/16 16:00
 * @Version 1.0
 */
@Service("sendAreaService")
public class SendAreaServiceImpl implements SendAreaService {

    @Resource
    SendAreaMapper sendAreaMapper = null;
    JsonResult jsonResult = new JsonResult();


    @Override
    public Integer sendAreaAdd(SendArea sendArea) {
        return sendAreaMapper.insertSelective(sendArea);
    }

    @Override
    public Integer sendAreaUpdate(SendArea sendArea) {
        return sendAreaMapper.updateByPrimaryKeySelective(sendArea);
    }

    @Override
    public Integer sendAreaDelete(Integer id) {
        SendArea sendArea = new SendArea();
        sendArea.setId(id);
        return sendAreaMapper.deleteByPrimaryKey(sendArea);
    }

    @Override
    public List<SendArea> sendAreaList() {
        return sendAreaMapper.selectAll();
    }
}
